import request from '@/utils/request'
/**
 * 查询企业的部门列表
 */
export function getDepartmentList() {
  return request({
    url: '/company/department'
  })
}
/**
 * 根据ID删除部门
 */
export function removeDepartments(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
/**
 * 新增部门
 * @param {Object} data {code,introduce,manager,name,pid}
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
/**
 * 根据ID查询部门详情
 * @param {*} id 部门id
 */
export function getDepartmentsById(id) {
  return request({
    url: '/company/department/' + id
  })
}
/**
 * 根据ID修改部门详情
 * @param {object} data 编辑部门的对象参数
 */
export function editDepartmentsById(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
